###
 # @Company: TWL
 # @Author: xue jian
 # @Email: xuejian@kanzhun.com
 # @Date: 2020-05-21 20:45:48
### 
#!/bin/sh

#B 端开聊数据流 
bossrec_fid_flow(){
    tmp=$1
    target_file=/basicdata/kafka/boss/arc/recommender/bossrec_fid_flow/ds=$tmp/*
    # echo $target_file
    hdfs dfs -getmerge $target_file /data3/training_data/arc_six/bossrec_chat_fid_flow/$tmp
}

# #B 端达成数据流 
bossrec_success_fid_flow(){
    tmp=$1
    target_file=/basicdata/kafka/boss/arc/recommender/bossrec_success_fid_flow/ds=$tmp/*
    # echo $target_file
    hdfs dfs -getmerge $target_file /data3/training_data/arc_six/bossrec_success_fid_flow/$tmp
}

# # C 端开聊数据流
geekrec_fid_flow(){
    tmp=$1
    target_file=/basicdata/kafka/boss/arc/recommender/geekrec_fid_flow/ds=$tmp/*
    # echo $target_file
    hdfs dfs -getmerge $target_file /data3/training_data/arc_six/geekrec_chat_fid_flow/$tmp
}

main () {
    datebeg=$1
    dateend=$2
    beg_s=`date -d "$datebeg" +%s`
    end_s=`date -d "$dateend" +%s`
    while [ "$beg_s" -le "$end_s" ]
    do
        tmp=`date -d @$beg_s +"%Y-%m-%d"`
        echo $tmp

        bossrec_fid_flow $tmp

        beg_s=$((beg_s+86400))
    done
}

main 2020-07-21 2020-07-21
